package com.yunfeisoft.business.model;

import com.applet.base.ServiceModel;
import org.joda.time.DateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * ClassName: SmsFlashPromotionSession
 * Description: 限时购场次表
 *
 * @Author: Jackie liu
 * Date: 2020-06-02
 */
@Entity
@Table(name = "SMS_FLASH_PROMOTION_SESSION")
public class SmsFlashPromotionSession extends ServiceModel implements Serializable {

    /**
     * Field serialVersionUID: 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 场次名称
     */
    @Column
    private String name;

    /**
     * 每日开始时间
     */
    @Column
    private Date startDate;

    /**
     * 每日结束时间
     */
    @Column
    private Date endDate;

    /**
     * 启用状态：0->不启用；1->启用
     */
    @Column
    private Integer status;

    public String getStartDateStr() {
        if (startDate != null) {
            return new DateTime(startDate).toString("HH:mm:ss");
        }
        return null;
    }

    public String getEndDateStr() {
        if (endDate != null) {
            return new DateTime(endDate).toString("HH:mm:ss");
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }


}